namespace SmartSoft.ReportForms
{
    using SmartSoft;
    using SmartSoft.Controls;
    using SmartSoft.ADP;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormBCTDBH3Viewer : FormReportViewer
    {
        private IContainer components;
        private TextDate txtNgay;
        private LabelControl lblTu_Ngay;

        public FormBCTDBH3Viewer()
        {
            this.InitializeComponent();
            this.txtNgay.Value = AppInstance.StartWorkingDate;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormBCTDBH1Viewer));
            this.txtNgay = new SmartSoft.Controls.TextDate();
            this.lblTu_Ngay = new SmartSoft.Controls.LabelControl();
            this.rptContainer.Panel1.SuspendLayout();
            this.rptContainer.SuspendLayout();
            this.SuspendLayout();
            // 
            // rptContainer
            // 
            // 
            // rptContainer.Panel1
            // 
            this.rptContainer.Panel1.Controls.Add(this.txtNgay);
            this.rptContainer.Panel1.Controls.Add(this.lblTu_Ngay);
            this.rptContainer.Size = new System.Drawing.Size(794, 501);
            this.rptContainer.SplitterDistance = 88;
            // 
            // txtNgay
            // 
            this.txtNgay.DateTimeFormat = SmartSoft.Controls.TextDate.DateTimeFormatType.Date;
            this.txtNgay.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtNgay.InsertKeyMode = System.Windows.Forms.InsertKeyMode.Overwrite;
            this.txtNgay.Location = new System.Drawing.Point(108, 26);
            this.txtNgay.Mask = "00/00/0000";
            this.txtNgay.Name = "txtNgay";
            this.txtNgay.OldValue = null;
            this.txtNgay.Size = new System.Drawing.Size(100, 20);
            this.txtNgay.TabIndex = 6;
            this.txtNgay.Value = ((object)(resources.GetObject("txtNgay.Value")));
            // 
            // lblTu_Ngay
            // 
            this.lblTu_Ngay.AutoSize = true;
            this.lblTu_Ngay.Font = new System.Drawing.Font("Arial", 8.25F);
            this.lblTu_Ngay.Location = new System.Drawing.Point(12, 29);
            this.lblTu_Ngay.Name = "lblTu_Ngay";
            this.lblTu_Ngay.Size = new System.Drawing.Size(74, 14);
            this.lblTu_Ngay.TabIndex = 107;
            this.lblTu_Ngay.Text = "Ngày báo cáo";
            // 
            // FormBCTDBH1Viewer
            // 
            this.CheckDetailMost = true;
            this.ClientSize = new System.Drawing.Size(794, 528);
            this.Name = "FormBCTDBH1Viewer";
            this.rptContainer.Panel1.ResumeLayout(false);
            this.rptContainer.Panel1.PerformLayout();
            this.rptContainer.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        protected override void OnGenerateColumns()
        {
            object[][] objArray = new object[6][];
            object[] objArray1 = new object[4];
            objArray1[0] = "Han_BH";
            objArray1[1] = "Ngày";
            objArray1[2] = "D";
            objArray[0] = objArray1;

            object[] objArray2 = new object[4];
            objArray2[0] = "Ma_Ts";
            objArray2[1] = "Mã tài sản";
            objArray2[2] = "C";
            objArray[1] = objArray2;
            
            object[] objArray3 = new object[4];
            objArray3[0] = "Ten_Ts";
            objArray3[1] = "Tên tài sản";
            objArray3[2] = "C";
            objArray[2] = objArray3;
            
            object[] objArray4 = new object[4];
            objArray4[0] = "Dvt";
            objArray4[1] = "Đơn vị tính";
            objArray4[2] = "C";
            objArray[3] = objArray4;
            
            object[] objArray5 = new object[4];
            objArray5[0] = "So_Hieu";
            objArray5[1] = "Số hiệu";
            objArray5[2] = "C";
            objArray[4] = objArray5;
            
            object[] objArray6 = new object[4];
            objArray6[0] = "Cong_Suat";
            objArray6[1] = "Cấu hình";
            objArray6[2] = "C";
            objArray[5] = objArray6;
            base.LocalColNames = objArray;
            base.OnGenerateColumns();
        }

        protected override void OnMakeReport()
        {
            AppInstance.StartWorkingDate = (DateTime)this.txtNgay.Value;
            base.LocalTable = new ReportDataAccess().BCTinhTrangTS_Get(AppInstance.Subsidiaries, this.txtNgay.Value, "C", 3);
            base.OnMakeReport();
        }

        protected override void OnSendParameters()
        {
            base.StimulReport["Ngay"] = "Ngày báo cáo: " + string.Format("{0:dd/MM/yyyy}", this.txtNgay.Value);
        }
    }
}

